//********************************************************************************************************************//
//ORGANIZATION:
//AUTHOR: bpeng(bogers.peng@gmail.com)
//SUMMARY:
//********************************************************************************************************************//
#include "../Time.h"

using namespace Native::System;

CTime::CTime()
{
}

CTime::CTime(const CTime& that)
    :_ticks(that._ticks)
{
}

CTime::CTime(time_t nUtc)
    :_ticks(nUtc)
{
}

CTime::CTime(uint32_t year, uint32_t month, uint32_t day, uint32_t hour, uint32_t minute, uint32_t second)
{
}

CTime CTime::Now()
{
    return move(CTime(time(0)));
}

wstring CTime::ToString() const
{
    return ToLocalTimeString();
}

const CTime& CTime::operator=(const CTime& that)
{
    _ticks = that._ticks;

    return *this;
}

time_t CTime::Utc() const
{
    return _ticks;
}

wstring CTime::ToLocalTimeString() const
{
    return move(wstring(_wasctime(localtime(&_ticks))));
}

wstring CTime::ToUtcTimeString() const
{
    return move(wstring(_wasctime(gmtime(&_ticks))));
}